Data Visualisation → Communicating insights truthfully and with beauty
Truthfully – Representing data accurately and without bias; avoiding misleading visualisations
Beauty – Making data engaging, emphasise key points, and tell a story. Provide context and make it easy to understand
\[ P(\text{Dark}) \lt P(\text{Light}) \]
\[ \tiny P(\text{Dark} \cap \text{Male}) \lt P(\text{Dark} \cap \text{Female}) \lt P(\text{Light} \cap \text{Female}) \lt P(\text{Light} \cap \text{Male}) \]
1
SQL query to download all project data and write to csvRows: 1
Columns: 6
$ project_id <int> 29
$ project_name <chr> "Biden-Harris Transition DEI"
$ charity_name <chr> "Inclusive America"
$ hq_country <chr> "United States"
$ hq_city <chr> "Washington DC"
$ gdi_branch <chr> "Melbourne"
# A tibble: 11 × 2
hq_country n
<chr> <int>
1 Australia 39
2 Colombia 1
3 India 1
4 Indonesia 1
5 New Zealand 19
6 Spain 2
7 Taiwan 1
8 Thailand 1
9 Uganda 2
10 United Kingdom 2
11 United States 11
Question: Whats missing for both?
What might this visualisation struggle to communicate?
6/10
top causes of death in the global south
10%
are targeting these disease areas
<5%
of the world’s scientific research
Design
Test
Evaluate
infrastructure_as_code.(Terraform) == Goodlibrary(maps)
# Map data preparation with country name adjustments
d_projects <- d_projects %>%
mutate(hq_country = case_when(
hq_country == "United States" ~ "USA",
hq_country == "United Kingdom" ~ "UK",
TRUE ~ hq_country
))
# Load world map data
world_map <- map_data("world")
# Join your project data and prepare the map data
map_data <- world_map %>%
left_join(d_projects %>%
count(hq_country, name = "n_projects"), by = c("region" = "hq_country")) %>%
replace_na(list(n_projects = NA))
# Plotting the map
ggplot(map_data, aes(x = long, y = lat, group = group, fill = n_projects)) +
geom_polygon(color = "#1C1C1C", size = 0.15) + # Adjust border color for better visibility on dark background
scale_fill_gradient(low = "lightblue", high = "darkblue", name = "Number of Projects", na.value = "#313131") +
labs(title = "Number of Projects by Headquarters Country", x = "", y = "") +
theme_void() +
theme(
text = element_text(color = "white"), # Changes text color to white
plot.background = element_rect(fill = "black", color = NA), # Dark plot background
panel.background = element_rect(fill = "black", color = NA), # Dark panel background
panel.grid.major = element_blank(), # Adjust grid color and size
panel.grid.minor = element_blank(), # No minor grid
plot.title = element_text(color = "white", hjust = 0.5), # Title in white and centered
axis.text = element_blank(), # Remove axis text
axis.ticks = element_blank(), # Remove axis ticks
legend.background = element_rect(fill = "black", color = NA), # Dark legend background
legend.text = element_text(color = "white") # White legend text
)